<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
<!-- creator-cli.qdoc -->
  <title>Using Command Line Options | Qt Creator Manual</title>
  <link rel="stylesheet" type="text/css" href="style/offline-simple.css" />
  <script type="text/javascript">
    document.getElementsByTagName("link").item(0).setAttribute("href", "style/offline.css");
    // loading style sheet breaks anchors that were jumped to before
    // so force jumping to anchor again
    setTimeout(function() {
        var anchor = location.hash;
        // need to jump to different anchor first (e.g. none)
        location.hash = "#";
        setTimeout(function() {
            location.hash = anchor;
        }, 0);
    }, 0);
  </script>
</head>
<body>
<div class="header" id="qtdocheader">
  <div class="main">
    <div class="main-rounded">
      <div class="navigationbar">
        <table><tr>
<td ><a href="index.html">Qt Creator Manual</a></td><td >Using Command Line Options</td></tr></table><table class="buildversion"><tr>
<td id="buildversion" width="100%" align="right"><a href="index.html">Qt Creator Manual 4.11.1</a></td>
        </tr></table>
      </div>
    </div>
<div class="content">
<div class="line">
<div class="content mainContent">
  <link rel="prev" href="creator-project-generic.html" />
  <link rel="next" href="creator-keyboard-shortcuts.html" />
<p class="naviNextPrevious headerNavi">
<a class="prevPage" href="creator-project-generic.html">Setting Up a Generic Project</a>
<span class="naviSeparator">  &#9702;  </span>
<a class="nextPage" href="creator-keyboard-shortcuts.html">Keyboard Shortcuts</a>
</p><p/>
<div class="sidebar">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#using-custom-styles">Using Custom Styles</a></li>
</ul>
</div>
<div class="sidebar-content" id="sidebar-content"></div></div>
<h1 class="title">Using Command Line Options</h1>
<span class="subtitle"></span>
<!-- $$$creator-cli.html-description -->
<div class="descr"> <a name="details"></a>
<p>You can start Qt Creator and specify some options from the command line. For example, you can open a file to any line and column.</p>
<p>To specify command line options, enter the following command in the Qt Creator installation or build directory:</p>
<p><code>qtcreator [option] [filename[:line_number[:column_number]]]</code></p>
<p><b>Note: </b>You can use either a colon (:) or a plus sign (+) as a separator between the filename and line number and the line number and the column number. You can also use a space between the separator and the line number.</p><p>For example, on Windows:</p>
<ul>
<li><code>C:\qtcreator\bin&gt;qtcreator -help</code></li>
<li><code>C:\qtcreator\bin&gt;qtcreator C:\TextFinder\textfinder.cpp:100:2</code></li>
<li><code>C:\qtcreator\bin&gt;qtcreator C:\TextFinder\textfinder.cpp +100+2</code></li>
</ul>
<p>On <a href="nolink">macOS</a>:</p>
<ul>
<li><code>Qt\ Creator.app/Contents/MacOS/Qt\ Creator -help</code></li>
</ul>
<p>To open a project that is located in a particular folder, you can pass on the folder name as a command line argument. Qt Creator looks for a session that matches the folder name and loads it. Or it looks for a project file in the folder and opens it. For example:</p>
<p><code>qtcreator .</code></p>
<p><b>Note: </b>To run a self-built Qt Creator from the command line on Windows, make sure that the Qt installation directory is included in the PATH environment variable. You can enter the following command on the command line to add Qt to the path:</p><pre class="cpp">

  set PATH<span class="operator">=</span><span class="operator">&lt;</span>Qt_installation_directory<span class="operator">&gt;</span>\mingw\bin;c:<span class="operator">&lt;</span>Qt_installation_directory<span class="operator">&gt;</span>\bin;<span class="operator">%</span>PATH<span class="operator">%</span>

</pre>
<p>The following table summarizes the available options:</p>
<div class="table"><table class="generic">
 <thead><tr class="qt-style"><th >Option</th><th >Description</th></tr></thead>
<tr valign="top" class="odd"><td >-help</td><td >Display help on command line options.</td></tr>
<tr valign="top" class="even"><td >-version</td><td >Display Qt Creator version.</td></tr>
<tr valign="top" class="odd"><td >-client</td><td >Attempt to connect to an already running instance of Qt Creator.</td></tr>
<tr valign="top" class="even"><td >-pid</td><td >Attempt to connect to an already running instance of Qt Creator with the specified process ID.</td></tr>
<tr valign="top" class="odd"><td >-block</td><td >Open files in editors in a running Qt Creator instance and block the command line until the first editor is closed.</td></tr>
<tr valign="top" class="even"><td >-load &lt;plugin&gt;</td><td >Enable the specified plugin and all plugins that it depends on. You can combine <code>-load</code> and <code>-noload</code> options and specify both options multiple times to enable and disable several plugins. The actions are executed in the specified order.</td></tr>
<tr valign="top" class="odd"><td >-load all</td><td >Enables all plugins.</td></tr>
<tr valign="top" class="even"><td >-noload &lt;plugin&gt;</td><td >Disable the specified plugin and all plugins that depend on it.</td></tr>
<tr valign="top" class="odd"><td >-noload all</td><td >Disables all plugins.</td></tr>
<tr valign="top" class="even"><td >-profile</td><td >Output plugin start up and shut down profiling data.</td></tr>
<tr valign="top" class="odd"><td >-pluginpath &lt;path&gt;</td><td >Add a path where Qt Creator looks for plugins. To specify several paths, add the <code>-pluginpath</code> option for each path.</td></tr>
<tr valign="top" class="even"><td >-settingspath &lt;path&gt;</td><td >Override the default path where user settings are stored.</td></tr>
<tr valign="top" class="odd"><td >-installsettingspath &lt;path&gt;</td><td >Override the default path from where user-independent settings are read (for example written by the installer).</td></tr>
<tr valign="top" class="even"><td >-temporarycleansettings</td><td >Use clean settings for debug or testing reasons. The settings will be deleted when Qt Creator exits.</td></tr>
<tr valign="top" class="odd"><td >-color &lt;color&gt;</td><td >Core plugin: override the selected UI color.</td></tr>
<tr valign="top" class="even"><td >-presentationMode</td><td >Core plugin: display keyboard shortcuts as popups when you press them. Mostly useful when presenting Qt Creator to someone else.</td></tr>
<tr valign="top" class="odd"><td >-theme &lt;default | dark&gt;</td><td >Core plugin: apply a dark color theme to Qt Creator, without using stylesheets.</td></tr>
<tr valign="top" class="even"><td >-notour</td><td >Welcome plugin: Skip the UI tour on startup.</td></tr>
<tr valign="top" class="odd"><td >-debug &lt;pid&gt;</td><td >Debugger plugin: attach to the process with the given process ID.</td></tr>
<tr valign="top" class="even"><td >-debug &lt;executable&gt;[,kit=&lt;kit&gt;]</td><td >Debugger plugin: launch and debug the executable with the name <code>executable</code>. A <code>kit</code> can be specified by ID or name to point to non-default debuggers and sysroots.</td></tr>
<tr valign="top" class="odd"><td >-debug [executable,]core=&lt;corefile&gt;[,kit=&lt;kit&gt;]</td><td >Debugger plugin: load the core file named <code>corefile</code>. The parameter <code>executable</code> specifies the executable that produced the core file. If this parameter is omitted, Qt Creator will attempt to reconstruct it from the core file itself. This will fail for paths with more than about 80 characters. In such cases the <code>executable</code> parameter is mandatory. A <code>kit</code> can be specified by ID or name to point to non-default debuggers and sysroots.</td></tr>
<tr valign="top" class="even"><td >-debug &lt;executable&gt;,server=&lt;server:port&gt;[,kit=&lt;kit&gt;]</td><td >Debugger plugin: attach to a debug server running on the port <code>port</code> on the server <code>server</code>. The parameter <code>executable</code> specifies a local copy of the executable the remote debug server is manipulating. A <code>kit</code> can be specified by ID or name to point to non-default debuggers and sysroots.</td></tr>
<tr valign="top" class="odd"><td >-wincrashevent &lt;event-handle:pid&gt;</td><td >Debugger plugin: Attach to crashed processes by using the specified event handle and process ID.</td></tr>
<tr valign="top" class="even"><td >-customwizard-verbose</td><td >ProjectExplorer plugin: display additional information when loading custom wizards. For more information about custom wizards, see <a href="creator-project-wizards.html">Adding New Custom Wizards</a></td></tr>
<tr valign="top" class="odd"><td >-lastsession</td><td >ProjectExplorer plugin: load the last session when Qt Creator starts. Open the projects and files that were open when you last exited Qt Creator. For more information about managing sessions, see <a href="creator-project-managing-sessions.html">Managing Sessions</a>.</td></tr>
<tr valign="top" class="even"><td >&lt;session&gt;</td><td >ProjectExplorer plugin: load the given session when Qt Creator starts. Open the projects and files that were open when you last exited Qt Creator. For more information about managing sessions, see <a href="creator-project-managing-sessions.html">Managing Sessions</a>.</td></tr>
</table></div>
<a name="using-custom-styles"></a>
<h2 id="using-custom-styles">Using Custom Styles</h2>
<p>Qt Creator is a <a href="http://doc.qt.io/qt-5/qapplication.html">Qt application</a>, and therefore, it accepts the command line options that all Qt applications accept. For example, you can use the <code>-style</code> and <code>-stylesheet</code> options to apply custom styles and <a href="http://doc.qt.io/qt-5/stylesheet.html">stylesheets</a>. The styling is only applied during the current session.</p>
<p>Exercise caution when applying styles, as overriding the existing styling may make some items difficult to see. Also, setting a stylesheet may affect the <a href="creator-editor-options-text.html">text editor color scheme</a> and the styling of the integrated Qt Designer.</p>
<p>You can also switch to a dark theme to customize the appearance of widgets, colors, and icons without using stylesheets.</p>
</div>
<!-- @@@creator-cli.html -->
<p class="naviNextPrevious footerNavi">
<a class="prevPage" href="creator-project-generic.html">Setting Up a Generic Project</a>
<span class="naviSeparator">  &#9702;  </span>
<a class="nextPage" href="creator-keyboard-shortcuts.html">Keyboard Shortcuts</a>
</p>
        </div>
       </div>
   </div>
   </div>
</div>
<div class="footer">
   <p>
   <acronym title="Copyright">&copy;</acronym> 2019 The Qt Company Ltd.
   Documentation contributions included herein are the copyrights of
   their respective owners.<br>    The documentation provided herein is licensed under the terms of the    <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation    License version 1.3</a> as published by the Free Software Foundation.<br>    Qt and respective logos are trademarks of The Qt Company Ltd.     in Finland and/or other countries worldwide. All other trademarks are property
   of their respective owners. </p>
</div>
</body>
</html>
